const { promisify } = require('util')
import redis from 'redis'
import CONFIG from '../config'
let config = Object.assign({}, CONFIG.redis)
config.db = undefined
let client = redis.createClient(config)

const getAsync = promisify(client.get).bind(client)
const setAsync = promisify(client.set).bind(client)

export default {
  client,
  getAsync,
  setAsync
}
